package com.Ian.homework;

import java.util.Scanner;

public class StudentDao {
    public static void main(String[] args) {
        System.out.println("欢迎来到学生管理系统");
        System.out.println("【1】注册");
        System.out.println("【2】查看");
        System.out.println("【3】修改");
        System.out.println("【4】删除");
        System.out.print("请选择您的操作:");
        InterfaceStudentFunc iSt = new SubStudentFunc();
        Student st = new Student();
        Student stOut = new Student();

        Scanner sca = new Scanner(System.in);


        boolean stu = true;
        while(stu) {
            String stus = sca.nextLine();
            switch (stus) {
                case "1":
                    st.setStrName("name1");
                    st.setId(111);
                    st.setiAge(12);
                    iSt.add(st);
                    break;
                case "2":
                    iSt.sel();
                    break;
                case "3":
                    st.setStrName("name1");
                    st.setId(111);
                    st.setiAge(12);
                    stOut.setStrName("name2");
                    stOut.setId(112);
                    stOut.setiAge(12);
                    iSt.modify(st, stOut);
                    break;
                case "4":
                    st.setStrName("name1");
                    st.setId(111);
                    st.setiAge(12);
                    iSt.del(st);
                    break;
                default:
                    break;
            }
        }

    }

}

